package com.unified.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;

@RestController
@RequestMapping("/jacoco")
public class JacocoController {

    @GetMapping("/uuid")
    public String generateUUID() {
        return UUID.randomUUID().toString();
    }

    @GetMapping("/choose/{option}")
    public String choose(@PathVariable("option") String option) {
        if("A".equals(option)) {
            System.out.println("option A content");
            return "<span style='color: white;background: #9c27b0;'>your choice is A</span>";
        }else if("B".equals(option)) {
            System.out.println("option B content");
            return "<span style='color: white;background: #2196f3;'>your choice is B</span>";
        }else if("C".equals(option)) {
            System.out.println("option C content");
            return "<span style='color: white;background: #8bc34a;'>your choice is C</span>";
        }else if("D".equals(option)) {
            System.out.println("option D content");
            return "<span style='color: white;background: #ffc107;'>your choice is D</span>";
        }else if("E".equals(option)) {
            System.out.println("option E content");
            return "<span style='color: white;background: #607d8b;'>your choice is E</span>";
        }else {
            System.out.println("none content");
            return "<span style='color: white;background: #f44336;'>invalid option</span>";
        }
    }
}
